<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    
    <!-- Parent POM -->
    <parent>
        <groupId>org.gephi</groupId>
        <artifactId>gephi-parent</artifactId>
        <version>0.9-SNAPSHOT</version>
        <relativePath>../..</relativePath>
    </parent>

    <artifactId>gephi</artifactId>
    <packaging>nbm-application</packaging>
    <name>gephi-app</name>

    <!-- Dependencies -->
    <dependencies>
        <dependency>
            <groupId>org.netbeans.cluster</groupId>
            <artifactId>platform</artifactId>
            <type>pom</type>
            <exclusions>
                <exclusion>
                    <artifactId>org-jdesktop-layout</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-api-search</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-api-visual</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-core-execution</artifactId>
                    <groupId>org.netbeans.modules</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-core-netigso</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-core-osgi</artifactId>
                    <groupId>org.netbeans.modules</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-core-output2</artifactId>
                    <groupId>org.netbeans.modules</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-libs-osgi</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-libs-felix</artifactId>
                    <groupId>org.netbeans.modules</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-libs-jsr223</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-libs-testng</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-modules-core-kit</artifactId>
                    <groupId>org.netbeans.modules</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-modules-netbinox</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-openide-compat</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-openide-execution</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-openide-options</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-openide-util-enumerations</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-modules-editor-mimelookup-impl</artifactId>
                    <groupId>org.netbeans.modules</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-modules-print</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-modules-favorites</artifactId>
                    <groupId>org.netbeans.modules</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-modules-javahelp</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-modules-sampler</artifactId>
                    <groupId>org.netbeans.api</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>org-netbeans-modules-spi-actions</artifactId>
                    <groupId>org.netbeans.modules</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>gephi-branding</artifactId>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-nbjunit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>utils-longtask</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>project-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>graph-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>io-exporter-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>preview-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>io-exporter-preview</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>lib.validation</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>preview-export-ui</artifactId>
        </dependency>
        <!--        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>dynamic-api</artifactId>
        </dependency>-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>utils</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>datalab-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>visualization-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>preview-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>db-drivers</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>io-importer-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>io-processor-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>processor-plugin-ui</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>project-ui</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ui-utils</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ui-components</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>settings-upgrader</artifactId>
        </dependency>
        <!--        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>spigot-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>spigot-plugin-ui</artifactId>
        </dependency>-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>statistics-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>statistics-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>statistics-plugin-ui</artifactId>
        </dependency>
        <!--        <dependency>
                     <groupId>${project.groupId}</groupId>
                    <artifactId>timeline</artifactId>
                </dependency>
        -->        
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>tools-api</artifactId>
        </dependency>       
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>algorithms-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>gleem</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>mostrecentfiles-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-project</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>visualization</artifactId>
        </dependency>
        <!--        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>tools-plugin</artifactId>
        </dependency>-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>welcome-screen</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>workspace-ui</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-context</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-progress</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-branding</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>layout-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>io-generator-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>io-generator-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>generator-plugin-ui</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>io-exporter-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-statistics</artifactId>
        </dependency>
        <!--        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>filters-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>clustering-api</artifactId>
        </dependency>-->
        <!--        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ui-propertyeditor</artifactId>
        </dependency>-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>layout-plugin</artifactId>
        </dependency>
        <!--        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-spigot</artifactId>
        </dependency>-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-generate</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-datalab</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>appearance-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-appearance</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>io-importer-plugin</artifactId>
        </dependency>
        <!--
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>filters-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>filters-impl</artifactId>
        </dependency>-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>export-plugin-ui</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-recent-files</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-io-export</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>perspective-api</artifactId>
        </dependency>
        <!--        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-clustering</artifactId>
        </dependency>-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>import-plugin-ui</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-perspective</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>datalab-plugin</artifactId>
        </dependency>
        <!--        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>filters-plugin-ui</artifactId>
        </dependency>-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-layout</artifactId>
        </dependency>
        <!--        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>dynamic-impl</artifactId>
        </dependency>-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-import</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-preview</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>appearance-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>appearance-plugin-ui</artifactId>
        </dependency><!--
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-tools</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-timeline</artifactId>
        </dependency>-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>directory-chooser</artifactId>
        </dependency>
        <!--        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>desktop-filters</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>clustering-plugin</artifactId>
        </dependency>-->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>core-library-wrapper</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ui-library-wrapper</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            
            <!-- Disable the ZIP goal in the non-deployment or release mode. Also set up the location of the gephi.conf -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>nbm-maven-plugin</artifactId>
                <configuration>
                    <!-- Set up the gephi.conf for the final artifact -->
                    <etcConfFile>${basedir}/target/${brandingToken}.conf</etcConfFile>
                </configuration>
                <executions>
                    <execution>
                        <id>default-standalone-zip</id>
                        <phase>none</phase>       
                    </execution>
                </executions>
            </plugin>
            
            <!-- Copy ressources gephi.conf and Info.plist with filtering (replacing 'project.version' by the actual version -->
            <plugin> 
                <artifactId>maven-resources-plugin</artifactId> 
                <executions> 
                    <execution> 
                        <id>generate-app-conf-file</id> 
                        <phase>generate-resources</phase> 
                        <goals> 
                            <goal>copy-resources</goal> 
                        </goals> 
                        <configuration> 
                            <outputDirectory>${basedir}/target/</outputDirectory> 
                            <resources> 
                                <resource> 
                                    <directory>src/main/resources</directory> 
                                    <includes> 
                                        <include>${brandingToken}.conf</include>
                                        <include>Info.plist</include>
                                    </includes> 
                                    <filtering>true</filtering> 
                                </resource> 
                            </resources>
                            <escapeString>\</escapeString>
                        </configuration> 
                    </execution> 
                </executions> 
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- The deployment profile is built for daily releases. It builds the standalone 
        zip and the autoupdate site. It can be used with deploy-dmg to include the dmg as well. -->
        <profile>
            <id>deployment</id>
            
            <!-- Localization dependency -->
            <dependencies>
                <dependency>
                    <groupId>org.netbeans</groupId>
                    <artifactId>platform-localization</artifactId>
                    <type>zip</type>
                    <version>${gephi.platform.localization.version}</version>
                </dependency>
            </dependencies>
            
            <build>
                <plugins>
                    
                    <!-- NBM Plugin settings. Enable the zip and autoupdate generation -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>nbm-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-standalone-zip</id>
                                <phase>package</phase>       
                            </execution>
                            <execution>
                                <id>autoupdate</id>
                                <goals>
                                    <goal>autoupdate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    
                    <!-- Permits NbModuleSuite to be run in integration-test phase: -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <all.clusters>${all.clusters}</all.clusters>
                                <branding.token>${brandingToken}</branding.token>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                    
                    <!-- Avoid jar goal -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>none</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Unpack the localization dependency -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <configuration>
                                    <includeGroupIds>org.netbeans</includeGroupIds>
                                    <includeArtifactIds>platform-localization</includeArtifactIds>
                                    <outputDirectory>
                                        ${project.build.directory}/${brandingToken}
                                    </outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <profile>
            <id>upload-updates</id>
            <build>
                <plugins>
                    <!-- Upload the autoupdate site automatically -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>wagon-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>upload-jar-to-folder</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>upload</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <fromDir>${gephi.updates.site}</fromDir>
                            <includes>*</includes>
                            <url>${gephi.default.repository.url}</url>
                            <toDir>${gephi.updates.repository.path}</toDir>
                            <serverId>${gephi.default.repository.id}</serverId>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <!-- Profile used along with deployment to create the dmg archive -->
        <profile>
            <id>create-dmg</id>
            <build>
                <plugins>
                    
                    <!-- Create the Mac OS X application bundle and dmg file -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>create-app-bundle</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                
                                        <delete includeEmptyDirs="true" failonerror="false">
                                            <fileset dir="${project.build.directory}/${gephi.appbundle.name}.app"/>
                                            <fileset dir="${project.build.directory}/${gephi.app.title}"/>
                                            <fileset dir="${project.build.directory}/${project.artifactId}-${project.version}.dmg"/>
                                        </delete>
                                
                                        <mkdir dir="${project.build.directory}/${gephi.appbundle.name}.app"/>
                                        <mkdir dir="${project.build.directory}/${gephi.appbundle.name}.app/Contents/MacOS"/>
                                        
                                        <copy todir="${project.build.directory}/${gephi.appbundle.name}.app/Contents/Resources/${brandingToken}">
                                            <fileset dir="${project.build.directory}/${brandingToken}"/>
                                        </copy>
                                
                                        <copy tofile="${project.build.directory}/${gephi.appbundle.name}.app/Contents/Resources/${brandingToken}.icns" file="src/main/app-resources/${brandingToken}.icns" />
                                        <copy tofile="${project.build.directory}/${gephi.appbundle.name}.app/Contents/Info.plist" file="${project.build.directory}/Info.plist"/>
                                
                                        <chmod file="${project.build.directory}/${gephi.appbundle.name}.app/Contents/Resources/${brandingToken}/bin/${brandingToken}" perm="ugo+rx"/>
                                
                                        <symlink link="${project.build.directory}/${gephi.appbundle.name}.app/Contents/MacOS/Gephi" resource="../Resources/${brandingToken}/bin/${brandingToken}" failonerror="false" />

                                        <exec dir="${project.build.directory}" os="Mac OS X" executable="codesign">
                                            <arg value="-fs"/> 
                                            <arg value="${gephi.codesign.identity}"/> 
                                            <arg value="-v"/> 
                                            <arg value="${gephi.appbundle.name}.app"/> 
                                        </exec>
                                        
                                        <mkdir dir="${project.build.directory}/${gephi.app.title}"/>
                                        <move file="${project.build.directory}/${gephi.appbundle.name}.app" todir="${project.build.directory}/${gephi.app.title}/" />
                                        <symlink link="${project.build.directory}/${gephi.app.title}/Applications" resource="/Applications" failonerror="false" />
                                        
                                        <exec dir="${project.build.directory}" os="Mac OS X" executable="hdiutil">
                                            <arg value="create"/> 
                                            <arg value="-noanyowners"/> 
                                            <arg value="-imagekey"/> 
                                            <arg value="zlib-level=9"/> 
                                            <arg value="-srcfolder"/> 
                                            <arg value="${project.build.directory}/${gephi.app.title}"/> 
                                            <arg value="${project.artifactId}-${project.version}.dmg"/>
                                        </exec>

                                        <exec dir="${project.build.directory}" os="Linux" executable="mkisofs">
                                            <arg value="-V"/> 
                                            <arg value="${gephi.appbundle.name}"/>
                                            <arg value="-U"/>
                                            <arg value="-D"/>
                                            <arg value="-l"/>
                                            <arg value="-allow-multidot"/>
                                            <arg value="-max-iso9660-filenames"/>
                                            <arg value="-relaxed-filenames"/>
                                            <arg value="-no-iso-translate"/>
                                            <arg value="-r"/>
                                            <arg value="-o"/>
                                            <arg value="${project.artifactId}-${project.version}.dmg"/>
                                            <arg value="-root"/>
                                            <arg value="${project.build.directory}/${gephi.app.title}"/>
                                            <arg value="${project.build.directory}/${gephi.app.title}"/>
                                        </exec>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <!-- Profile used along with deployment to attach the dmg archive -->
        <profile>
            <id>deploy-dmg</id>
            <build>
                <plugins>
                    <!-- Attach the final DMG for deployment -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-dmg</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>attach-artifact</goal>
                                </goals>
                                <configuration>
                                    <artifacts>
                                        <artifact>
                                            <file>${project.build.directory}/${project.artifactId}-${project.version}.dmg</file>
                                            <type>dmg</type>
                                        </artifact>
                                    </artifacts>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>   
                </plugins>
            </build>
        </profile>
        
        <!-- Profile activated for windows/macos release only. Should be called alone so it only creates the windows installer/compressed dmg -->
        <profile>
            <id>release-extra</id>
            <build>
                <plugins>
                    <!-- Avoid updatesite.xml.gz attach -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>nbm-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-standalone-zip</id>
                                <phase>none</phase>       
                            </execution>
                            <execution>
                                <id>autoupdate</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <!-- Profile activated for windows release in addition of deployement. Create the installer. -->
        <profile>
            <id>release-windows</id>
            <build>
                <plugins>
                    
                    <!-- Copy and filter the InnoSetup config file, as well as icons -->
                    <plugin> 
                        <artifactId>maven-resources-plugin</artifactId> 
                        <executions> 
                            <execution> 
                                <id>generate-iss-file</id> 
                                <phase>generate-resources</phase> 
                                <goals> 
                                    <goal>copy-resources</goal> 
                                </goals> 
                                <configuration> 
                                    <outputDirectory>${basedir}/target</outputDirectory> 
                                    <resources> 
                                        <resource> 
                                            <directory>src/main/app-resources</directory> 
                                            <includes> 
                                                <include>${brandingToken}.iss</include>
                                            </includes> 
                                            <filtering>true</filtering> 
                                        </resource>
                                        <resource> 
                                            <directory>src/main/app-resources</directory> 
                                            <includes> 
                                                <include>${brandingToken}.ico</include>
                                                <include>${brandingToken}file128.png</include>
                                                <include>COPYING.txt</include>
                                            </includes> 
                                            <filtering>false</filtering> 
                                        </resource> 
                                    </resources> 
                                </configuration> 
                            </execution> 
                        </executions> 
                    </plugin>   
                    
                    <!-- Execute InnoSetup with the gephi.iss script -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>replace-windows-icon</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <!-- Windows-only target that replaces the icon for the launcher exe with our own icon. -->
                                    <target name="replaceWindowsLauncherIcon" description="Replace the icon for the Windows launcher exe">
                                        <echo message="Replacing icon of Windows launcher executable."/>
                                        <exec dir="src/main/app-resources" executable="ReplaceVistaIcon.exe" resolveexecutable="true">
                                            <arg line="${project.build.directory}/${brandingToken}/bin/${brandingToken}.exe gephi.ico 0"/>
                                        </exec>
                                        <exec dir="src/main/app-resources" executable="ReplaceVistaIcon.exe" resolveexecutable="true">
                                            <arg line="${project.build.directory}/${brandingToken}/bin/${brandingToken}.exe gephifile.ico 1"/>
                                        </exec>
                                        <exec dir="src/main/app-resources" executable="ReplaceVistaIcon.exe" resolveexecutable="true">
                                            <arg line="${project.build.directory}/${brandingToken}/bin/${brandingToken}64.exe gephi.ico 0"/>
                                        </exec>
                                        <exec dir="src/main/app-resources" executable="ReplaceVistaIcon.exe" resolveexecutable="true">
                                            <arg line="${project.build.directory}/${brandingToken}/bin/${brandingToken}64.exe gephifile.ico 1"/>
                                        </exec>
                                    </target>
                                </configuration>
                            </execution>
                            <execution>
                                <id>create-windows-installer</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <delete file="${project.artifactId}-${project.version}.setup.exe" failonerror="false"/>
                                        
                                        <exec dir="${project.build.directory}" executable="${gephi.innosetup.path}/Compil32.exe">
                                            <arg line="/cc '${brandingToken}.iss'" /> 
                                        </exec> 
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    
                    <!-- Deploy exe artifact -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy-file</goal>
                                </goals>
                                <configuration>
                                    <packaging>exe</packaging>
                                    <generatePom>false</generatePom>
                                    <repositoryId>${gephi.release.repository.id}</repositoryId>
                                    <url>${gephi.release.repository.url}</url>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <groupId>${project.groupId}</groupId>
                                    <version>${project.version}</version>
                                    <file>${project.build.directory}/${project.artifactId}-${project.version}.setup.exe</file>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <!-- Profile activated for macos release. Need to be called with profile deploy-dmg. -->
        <profile>
            <id>release-macos</id>
            <build>
                <plugins>
                    <!-- Deploy dmg artifact -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy-file</goal>
                                </goals>
                                <configuration>
                                    <packaging>dmg</packaging>
                                    <generatePom>false</generatePom>
                                    <repositoryId>${gephi.release.repository.id}</repositoryId>
                                    <url>${gephi.release.repository.url}</url>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <groupId>${project.groupId}</groupId>
                                    <version>${project.version}</version>
                                    <file>${project.build.directory}/${project.artifactId}-${project.version}.dmg</file>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
